#include <iostream>

using namespace std;

template <typename T>
void Swap(T& a, T& b)
{
    T t = a;
    a = b;
    b = t;
}

template <typename T>
class Operator
{
public:
    T process(T v)
    {
        return v * v;
    }
};

int main()
{
    int a = 2;
    int b = 1;

    Swap<int>(a, b);

    cout << "a = " << a << "; " << "b = " << b << ";"<< endl;

    double c = 0.02;
    double d = 0.05;

    Swap<double>(c, d);

    cout << "c = " << c << "; " << "d = " << d << ";"<< endl;

    Operator<int> op1;
    int aa = op1.process(5);
    cout << "aa = " << aa << endl;

    Operator<double> op2;
    double bb = op2.process(0.3);
    cout << "bb = " << bb << endl;

    return 0;
}
